﻿using System.Collections.Generic;
using Microsoft.Xna.Framework;

namespace Athanor.Gui
{
    public class SpriteGroup : Sprite
    {
        private List<Sprite> components = new List<Sprite>();

        public SpriteGroup(float x, float y)
            : base(x, y)
        {
        }

        public override void Draw(Vector2 parentPos, Vector2 parentScale)
        {
            base.Draw(Position + parentPos, Scale * parentScale);

            foreach (Sprite component in components)
                component.Draw(Position + parentPos, Scale * parentScale);
        }

        public void AddComponent(Sprite comp)
        {
            components.Add(comp);
        }

        public void RemoveComponent(Sprite comp)
        {
            components.Remove(comp);
        }

        public void RemoveAll()
        {
            components.Clear();
        }

    }

}
